<%@ page language="java" import="java.util.*,com.inspur.bean.User,com.inspur.bean.Address" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'EL01.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
	<%
		//获取JavaBean的属性
		User user=new User(1,"张三",23);
		request.setAttribute("user1", user);
		
		
		Address address=new Address("山东省","济南市","明水街道");
		User user2=new User(2,"李四",20,address);
		request.setAttribute("user2", user2);
		
		//访问数组
		String[] likes={"篮球","足球","学习"};
		User user3=new User();
		user3.setLikes(likes);
		request.setAttribute("user3", user3);
		
		
		//访问list集合
		 List<String> language=new ArrayList<String>();
		 language.add("C语言");
		 language.add("C++");
		 language.add("Java语言");
		 user.setLanguage(language);
		 request.setAttribute("user", user);
		 
		 
		 //访问map集合
		Map<String,Double> map= new HashMap<String,Double>();
		map.put("a.Tom",8000.00);
		map.put("李四",9000.00);
		map.put("王五",10000.00);
		request.setAttribute("map", map);
		
	 %>
	 
	 用户的姓名：${user1.userName}<br/>
	 		  ${user1["userName"]}<br/>
	 		  ${user1['userName']}<br/>
	 用户所在的城市:${user2.address.city}<br/>
	 用户的爱好:${user3.likes[2]}<br/>
			 ${user3.likes['0']}<br/>
			 ${user3.likes["1"]}<br/>
	 用户掌握的语言：${user.language[2]}<br/>
			 ${user.language['0']}<br/>
			 ${user.language["1"]}<br/>
	 用户的薪水:${map['a.Tom']}<br/>
			${map['张三']}<br/>
			${map["王五"]}<br/>
  </body>
</html>
